import React from 'react';
import { connect } from "react-redux";
import { Button } from 'antd';

function Page(props) {
  const { demo2, dispatch } = props
  const { name } = demo2

  const handleClick = () => {
    dispatch({
      type: 'CHANGE_NAME',
      data: Date.now()
    })
  }
  return (
    <div className="container">
      <h1>demo2--{name}</h1>
      <div><Button type="primary" onClick={handleClick}>按钮</Button></div>
    </div>
  )
}

export default connect(({ demo2 }) => ({ demo2 }))(Page);
